package com.learning.generator.config;

import com.learning.generator.core.DefaultBaseInfoConstant;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;

import javax.annotation.PostConstruct;
import java.util.List;

@Data
@ConfigurationProperties(prefix = "xxx.generator")
public class XxxGeneratorProperties {

    private String jdbcUrl;
    private String jdbcUserName;
    private String jdbcPassword;
    private String[] tables;
    private String[] tablePrefix;
    private String projectPath = System.getProperty("user.dir");
    private String codeAuthor = "xxx";
    private String commentDatePattern = "yyyy-MM-dd";
    private String codeOutputDir = "/src/main/java";
    private String codeParentPackage;
    private String codeModuleName;
    private String controllerPackage;
    private String servicePackage;
    private String serviceImplPackage;
    private String entityPackage;
    private String mapperPackage;
    private String xmlResourcePackage = "/src/main/resources/mapper";
    private String superClass;
    private List<String> superEntityColumnList;

    @PostConstruct
    public void baseInfoInit() {
        DefaultBaseInfoConstant.baseInfoInit(this);
    }
}
